<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="itheima" uri="http://itheima.com/common/"%>
<%@ include file="/common/base.jsp"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="<%=path %>/css/pintuer.css">
<link rel="stylesheet" href="<%=path %>/css/admin.css">
<script src="<%=path %>/js/jquery.js"></script>
<script src="<%=path %>/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>修改成员</strong></div>
  <div class="body-content">
    <form method="post" class="form-x"  action="<%=basePath%>/user/updateUser.action" id="listform">
    <!--数据项 begin -->  
      <div class="form-group">
        <div class="label">
          <label>工号：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" readonly="readonly"  value="${user.id}" name="id" data-validate="required:请输入工号" />
          <div class="tips"></div>
        </div>
      </div>
      <!--数据项 end -->
       <!--数据项 begin -->  
       <div class="form-group"> 
        <div class="label">
          <label>姓名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="${user.name}" name="name" data-validate="required:请输入姓名" />
          <div class="tips"></div>
        </div>
      </div>
      <!--数据项 end -->
          <!--数据项 begin -->  
      <div class="form-group">
        <div class="label">
          <label>密码：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="${user.password}" name="password" data-validate="required:请输入密码" />
          <div class="tips"></div>
        </div>
      </div>
      <!--数据项 end -->
      <!--数据项 begin -->  
      <div class="form-group">
        <div class="label">
          <label>科室：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="${user.department}" name="department" data-validate="required:请输入科室" />
          <div class="tips"></div>
        </div>
      </div>
         
      <!--数据项 end -->
       <!--数据项 begin -->  
      <div class="form-group">
        <div class="label">
          <label>员工类别：</label>
           </div>
          
        					<div class="field" style="padding-top:8px;">
						          管理员 <input id="type1" name="type" type="radio" checked="checked"
							value=" 管理员" /> 员工<input id="type2" name="type" type="radio"
							value="员工" />
						
							<div class="tips"></div>
					</div>
				</div>
         
      <!--数据项 end -->
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit" onclick="updateUser()"> 提交</button>
        </div>
      </div>
    </form>
  </div>
<%-- <script>
	// 创建客户
    function createUser() {
    $.post("<%=basePath%>user/createUser.action",
		$("#listform").serialize(),function(data){
	        if(data =="OK"){
	            alert("客户创建成功！");
	            window.location.reload();
	        }else{
	            alert("客户创建失败！");
	            window.location.reload();
	        }
	   });
	}
</script> --%>
	<script>
		// 通过id获取修改的客户信息
	function editUser(id) {
	    $.ajax({
	        type:"get",
	        url:"<%=basePath%>user/getUserById.action",
	        data:{"":id},
	        success:function(data) {
	            $("#id").val(data.id);
	            $("#name").val(data.name);
	            $("#password").val(data.password)
	            $("#department").val(data.department)
	            $("#type").val(data.type)   
	        }
	    });
	}
	</script>
</body></html>

